home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / nwt2.exe / NWDIAG.BAS < prev    next >
BASIC Source File  |  1993-06-03  |  16KB  |  418 lines

  1. 'NWDIAG.BAS  NetWare Diagnostics Services Interface for Visual Basic For Windows
  2. 'Version 1.0
  3. 'Novell Systems Research Department, Novell, Inc.
  4. 'Copyright (c) 1993, Novell, Inc.
  5. 'This interface is not supported through Novell's regular
  6. 'support channels.  See README.TXT for more information.
  7.  
  8. Global Const MAX_NETWORKS = 120
  9. Global Const MAX_SERVERS = 150
  10. Global Const MAX_NODES = 120
  11. Global Const MAX_EXCLUSIONS = 80
  12.  
  13. Global Const MAX_COMPONENTS = 10
  14. Global Const MAX_LOCAL_NETWORKS = 4
  15. Global Const MAX_ROUTES = 47
  16.  
  17. Global Const MAX_IPX_PACKET_SIZE = 576
  18.  
  19. Global Const IPX_SPX_COMPONENT = 0
  20. Global Const BRIDGE_DRIVER_COMPONENT = 1
  21. Global Const SHELL_DRIVER_COMPONENT = 2
  22. Global Const SHELL_COMPONENT = 3
  23. Global Const VAP_SHELL_COMPONENT = 4
  24. Global Const BRIDGE_COMPONENT = 5
  25. Global Const FILE_SERVER_COMPONENT = 6
  26. Global Const NONDEDICATED_IPX_SPX_COMPONENT = 7
  27. Global Const IPX_ONLY = 8
  28.  
  29. Global Const NO_ERRORS = &H0
  30. Global Const COULD_NOT_GET_LOCAL_TARGET = &HFF
  31. Global Const COULD_NOT_OPEN_SOCKET = &HFE
  32. Global Const COULD_NOT_BEGIN_CONNECTION = &HFD
  33. Global Const COULD_NOT_ESTABLISH_CONNECTION = &HFC
  34. Global Const COULD_NOT_TERMINATE_CONNECTION = &HFB
  35. Global Const BAD_CONNECTION_ID = &HFA
  36. Global Const COULD_NOT_SEND_REQUEST = &HF9
  37. Global Const RECEIVED_REPLY_IN_ERROR = &HF8
  38. Global Const NETWORK_NOT_FOUND = &HEF
  39. Global Const NO_RESPONSE_FROM_DESTINATION = &HEE
  40. Global Const RESPONSE_COMPLETION_CODE_BAD = &HED
  41. Global Const LIST_SIZE_TOO_SMALL = &HEC
  42. Global Const INTERNAL_LIST_ERROR = &HEB
  43. Global Const NODE_NOT_FOUND_OR_NO_RESPONSE = &HEA
  44. Global Const MEMORY_ALLOCATION_ERROR = &HDF
  45. Global Const VERSION_DOES_NOT_SUPPORT = &HDE
  46.  
  47. Type NodeAddress
  48.     nodeHi As Long
  49.     nodeLo As Integer
  50. End Type
  51.  
  52. Type IPXAddress
  53.     network As Long
  54.     nodeAddr As NodeAddress
  55.     socket As Integer
  56. End Type
  57.  
  58. Type IPXHeader
  59.     checkSum As Integer
  60.     length As Integer
  61.     transportControl As String * 1
  62.     packetType As String * 1
  63.     destination As IPXAddress
  64.     source As IPXAddress
  65. End Type
  66.     
  67. Type SPXHeader
  68.     checkSum As Integer
  69.     length As Integer
  70.     transportControl As String * 1
  71.     packetType As String * 1
  72.     destination As IPXAddress
  73.     source As IPXAddress
  74.     connectionControl As String * 1
  75.     dataStreamType As String * 1
  76.     sourceConnectionID As Integer   'high-low unsigned
  77.     destConnectionID As Integer     'high-low unsigned
  78.     sequenceNumber As Integer       'high-low unsigned
  79.     acknowledgeNumber As Integer    'high-low unsigned
  80.     allocationNumber As Integer     'high-low unsigned
  81. End Type
  82.  
  83. Type ECBFragment
  84.     address As Long
  85.     size As Integer
  86. End Type
  87.  
  88. Type ECB
  89.     linkAddress As Long
  90.     esrAddress As Long
  91.     inUseFlag As String * 1
  92.     completionCode As String * 1
  93.     socketNumber As Integer
  94.     ipxWorkspace As String * 4
  95.     driverWorkspace As String * 12
  96.     immediateAddress As IPXAddress
  97.     fragmentCount As Integer
  98.     fragmentDescriptor As ECBFragment
  99. End Type
  100.  
  101. Type CONNECTION_INFO
  102.     connectionState As String * 1
  103.     connectionFlags As String * 1
  104.     sourceConnectionID As Integer           'high-low byte order
  105.     destinationConnectionID As Integer      'hi-lo
  106.     sequenceNumber As Integer               'hi-lo
  107.     acknowlegeNumber As Integer             'hi-lo
  108.     allocationNumber As Integer             'hi-lo
  109.     remoteAcknowledgeNumber As Integer      'hi-lo
  110.     remoteAllocationNumber As Integer       'hi-lo
  111.     connectionSocket As Integer
  112.     immediateAddress As IPXAddress
  113.     destination As IPXAddress
  114.     retransmissionCount As Integer          'hi-lo
  115.     estimatedRoundTripDelay As Integer      'hi-lo
  116.     retransmittedPackets As Integer         'hi-lo
  117.     suppressedPackets As Integer            'hi-lo
  118. End Type
  119.  
  120. Type BeginDiagnosticStruct     'same as IPXAddress
  121.     network As Long
  122.     nodeAddr As NodeAddress
  123.     socket As Integer
  124. End Type
  125.  
  126. Type AllResponseData
  127.     completionCode As String * 1
  128.     intervalMarker As Long
  129. End Type
  130.  
  131. Type IPXSPXVersion
  132.     IPXMajorVersion As String * 1
  133.     IPXMinorVersion As String * 1
  134.     SPXMajorVersion As String * 1
  135.     SPXMinorVersion As String * 1
  136. End Type
  137.  
  138. Type IPXStatisticsStruct
  139.     sendPacketCount As Long
  140.     malformedPacketCount As Integer
  141.     getECBRequestCount As Long
  142.     getECBFailureCount  As Long
  143.     aesEventCount As Long
  144.     postponedAESEventCount As Integer
  145.     maxConfiguredSocketsCount As Integer
  146.     maxOpenSocketsCount As Integer
  147.     openSocketFailureCount As Integer
  148.     listenECBCount As Long
  149.     ecbCancelFailureCount As Integer
  150.     findRouteFailureCount As Integer
  151. End Type
  152.  
  153. Type SPXStatisticsStruct
  154.     maxConnectionsCount As Integer
  155.     maxUsedConnectionsCount As Integer
  156.     establishConnectionRequest As Integer
  157.     establishConnectionFailure As Integer
  158.     listenConnectionRequestCount As Integer
  159.     listenConnectionFailureCount As Integer
  160.     sendPacketCount As Long
  161.     windowChokeCount As Long
  162.     badSendPacketCount As Integer
  163.     sendFailureCount As Integer
  164.     abortConnectionCount As Integer
  165.     listenPacketCount As Long
  166.     badListenPacketCount As Integer
  167.     incomingPacketCount As Long
  168.     badIncomingPacketCount As Integer
  169.     suppressedPacketCount As Integer
  170.     noSessionListenECBCount As Integer
  171.     watchdogDestroySessionCount As Integer
  172. End Type
  173.  
  174. Type ReturnReceivedPacketStruct
  175.     receivedPackets As Integer
  176. End Type
  177.  
  178. Type StartCountingPacketsStruct
  179.     destinationSocket As Integer
  180. End Type
  181.  
  182. Type SendPacketsRequestStruct
  183.     target As BeginDiagnosticStruct
  184.     immediateAddress As String * 6
  185.     numberOfPackets As Integer
  186.     timerTickInterval As String * 1
  187.     packetsPerTickInterval As String * 1
  188.     packetSize As Integer
  189.     changeSize As Integer
  190. End Type
  191.  
  192. Type SendPacketsResponseStruct
  193.     numberOfTransmitErrors As Integer
  194. End Type
  195.  
  196. Type DriverConfigurationStruct
  197.     networkAddr As Long
  198.     nodeAddr As NodeAddress
  199.     lanMode As String * 1
  200.     nodeAddressType As String * 1
  201.     maxDataSize As Integer
  202.     reserved1 As Integer
  203.     lanHardwareID As String * 1
  204.     transportTime As Integer
  205.     reserved2 As String * 12
  206.     majorVersion As String * 1
  207.     minorVersion As String * 1
  208.     ethernetFlagBits As String * 1
  209.     selectedConfiguration As String * 1
  210.     lanDescription As String * 80
  211.     ioAddress1 As Integer
  212.     ioDecodeRange1 As Integer
  213.     ioAddress2 As Integer
  214.     ioDecodeRange2 As Integer
  215.     memoryAddress1 As String * 3
  216.     memoryDecodeRange1 As Integer
  217.     memoryAddress2 As String * 3
  218.     memoryDecodeRange2 As String * 3
  219.     interruptIsUsed1 As String * 1
  220.     interruptLine1 As String * 1
  221.     interruptIsUsed2 As String * 1
  222.     interruptLine2 As String * 1
  223.     dmaIsUsed1 As String * 1
  224.     dmaLine1 As String * 1
  225.     dmaIsUsed2 As String * 1
  226.     dmaLine2 As String * 1
  227.     microChannelFlagBits As String * 1
  228.     reserved3 As String * 1
  229.     textDescription As String * 80
  230. End Type
  231.  
  232. Type DriverStatisticsStruct
  233.     driverVersion As String * 2
  234.     statisticsVersion As String * 2
  235.     totalTxPacketCount As Long
  236.     totalRxPacketCount As Long
  237.     noECBAvailableCount As Integer
  238.     packetTxTooBigCount As Integer
  239.     packetTxTooSmallCount As Integer
  240.     packetRxOverflowCount As Integer
  241.     packetRxTooBigCount As Integer
  242.     packetRxTooSmallCount As Integer
  243.     packetTxMiscErrorCount As Integer
  244.     packetRxMiscErrorCount As Integer
  245.     retryTxCount As Integer
  246.     checksumErrorCount As Integer
  247.     hardwareRxMismatchCount As Integer
  248.     numberOfCustomVariables As Integer
  249.     variableData As String * 495
  250. End Type
  251.  
  252. Type BridgeDriverStatusStruct
  253.     boardStatus As String * 4
  254. End Type
  255.  
  256. Type ComponentList
  257.     components As String * 540
  258. End Type
  259.  
  260. Type OSVersionStruct
  261.     machineID As String * 1
  262.     versionData As String * 41
  263. End Type
  264.  
  265. Type PrimaryServerStruct
  266.     number As String * 1
  267. End Type
  268.  
  269. Type ServerAddressTableStruct
  270.     serverUsed As String * 1
  271.     orderNumber As String * 1
  272.     serverNetwork As Long
  273.     serverNode As NodeAddress
  274.     serverSocket As Integer
  275.     receivedTimeout As Integer
  276.     immediateNode As NodeAddress
  277.     sequenceNumber As String * 1
  278.     connectionNumber As Long
  279.     connectionOK As String * 1
  280.     maximumTimeout As Integer
  281.     reserved As String * 5
  282. End Type
  283.  
  284. Type ServerNameTableStruct
  285.     nameTable0 As String * 48
  286.     nameTable1 As String * 48
  287.     nameTable2 As String * 48
  288.     nameTable3 As String * 48
  289.     nameTable4 As String * 48
  290.     nameTable5 As String * 48
  291.     nameTable6 As String * 48
  292.     nameTable7 As String * 48
  293. End Type
  294.  
  295. Type ShellStatisticsStruct
  296.     shellRequestsCount As Long
  297.     operatorAbortsCount As Integer
  298.     timeoutsCount As Integer
  299.     writeErrorCount As Integer
  300.     invalidReplyHeaderCount As Integer
  301.     invalidSlotCount As Integer
  302.     invalidSequenceNumberCount As Integer
  303.     errorReceivingCount As Integer
  304.     noRouterFoundCount As Integer
  305.     beingProcessedCount As Integer
  306.     unknownErrorCount As Integer
  307.     invalidServerSlotCount As Integer
  308.     networkGoneCount As Integer
  309.     reserved As Integer
  310.     allocateCannotFindRouteCount As Integer
  311.     allocateNoSlotsAvailableCount As Integer
  312.     allocateServerIsDownCount As Integer
  313. End Type
  314.  
  315. Type ShellVersionStruct
  316.     minor As String * 1
  317.     major As String * 1
  318.     rev As String * 1
  319. End Type
  320.  
  321. Type AllKnownNetworksStruct
  322.     numberOfNetworkAddresses As Integer
  323.     networkAddresses(128) As Long     'up to 128 4-byte addresses
  324. End Type
  325.  
  326. Type ServerInfoStruct
  327.     serverType As Integer
  328.     serverName As String * 48
  329. End Type
  330.  
  331. Type AllKnownServersStruct
  332.     numberOfServers As Integer
  333.     serverInfo(50) As ServerInfoStruct
  334. End Type
  335.  
  336. Type BridgeStatisticsStruct
  337.     tooManyHopsCount As Integer
  338.     unknownNetworkCount As Integer
  339.     noSpaceForServiceCount As Integer
  340.     noReceiveBuffersCount As Integer
  341.     notMyNetwork As Integer
  342.     netBIOSPropogateCount As Long
  343.     totalPacketsServiced As Long
  344.     totalPacketsRouted As Long
  345. End Type
  346.  
  347. Type LOCAL_ADDRESS
  348.     address As String * 6
  349.     reserved As String * 2
  350. End Type
  351.  
  352. Type LocalTablesStruct
  353.     localNetNumbers(16) As Long '16 4-byte net numbers
  354.     localNodeAddresses(16) As LOCAL_ADDRESS
  355. End Type
  356.  
  357. Type RoutingInfoStruct
  358.     routerForwardingAddress As Long
  359.     routerBoardNumber As String * 1
  360.     reserved As String * 2
  361.     routeHops As String * 1
  362.     routeTime As String * 1
  363. End Type
  364.  
  365. Type SpecificNetworkInfoStruct
  366.     networkAddress As Long
  367.     hopsToNet As String * 1
  368.     reserved  As String * 7
  369.     routeTimeToNet As Integer
  370.     numberOfKnownRouters As Integer
  371.     routingInfo(47) As RoutingInfoStruct     'up to 47 structures
  372. End Type
  373.  
  374. Type RouteSourceInfoStruct
  375.     routeSourceAddress As NodeAddress
  376.     routeHopsToSource As Integer
  377.     reserved As String * 2
  378. End Type
  379.  
  380. Type SpecificServerInfoStruct
  381.     serverInfo As ServerInfoStruct
  382.     serverAddress As BeginDiagnosticStruct
  383.     hopsToServer As Integer
  384.     reserved As Integer
  385.     numberOfRoutes As Integer
  386.     routeSourceInfo(47) As RouteSourceInfoStruct
  387. End Type
  388.  
  389. Declare Function AbortSendingPackets Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%) As Integer
  390. Declare Function GetIPXSPXVersion Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As IPXSPXVersion) As Integer
  391. Declare Function GetIPXStatistics Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As IPXStatisticsStruct) As Integer
  392. Declare Function GetSPXStatistics Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As SPXStatisticsStruct) As Integer
  393. Declare Function ReturnReceivedPacketCount Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As ReturnReceivedPacketStruct) As Integer
  394. Declare Function StartCountingPkts Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As StartCountingPacketsStruct) As Integer
  395. Declare Function StartSendingPktsTimed Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, requestData As SendPacketsRequestStruct, response As AllResponseData, responseData As SendPacketsResponseStruct, ByVal ticks%) As Integer
  396. Declare Function GetBridgeDriverConfiguration Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, ByVal LANBoardNumber%, response As AllResponseData, responseData As DriverConfigurationStruct) As Integer
  397. Declare Function GetBridgeDriverStatistics Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, ByVal LANBoardNumber%, response As AllResponseData, responseData As DriverStatisticsStruct) As Integer
  398. Declare Function GetBridgeDriverStatus Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As BridgeDriverStatusStruct) As Integer
  399. Declare Function GetShellDriverConfiguration Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As DriverConfigurationStruct) As Integer
  400. Declare Function GetShellDriverStatistics Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As DriverStatisticsStruct) As Integer
  401. Declare Function BeginDiagnostics Lib "NWIPXSPX.DLL" (destination As BeginDiagnosticStruct, connectionID%, compList As ComponentList) As Integer
  402. Declare Function EndDiagnostics Lib "NWIPXSPX.DLL" (ByVal connectionID%) As Integer
  403. Declare Function FindComponentOffset Lib "NWIPXSPX.DLL" (compList As ComponentList, ByVal componentID%) As Integer
  404. Declare Function GetOSVersionInfo Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As OSVersionStruct) As Integer
  405. Declare Function GetPrimaryServerNumber Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As PrimaryServerStruct) As Integer
  406. Declare Function GetServerAddressTable Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As ServerAddressTableStruct) As Integer
  407. Declare Function GetServerNameTable Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As ServerNameTableStruct) As Integer
  408. Declare Function GetShellAddress Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As IPXAddress) As Integer
  409. Declare Function GetShellStatistics Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber, response As AllResponseData, responseData As ShellStatisticsStruct) As Integer
  410. Declare Function GetShellVersionInfo Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As ShellVersionStruct) As Integer
  411. Declare Function GetAllKnownNetWorks Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, ByVal nextNetworkOffset%, response As AllResponseData, responseData As AllKnownNetworksStruct) As Integer
  412. Declare Function GetAllKnownServers Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, ByVal numberServersToSkip%, response As AllResponseData, responseData As AllKnownServersStruct) As Integer
  413. Declare Function GetBridgeStatistics Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As BridgeStatisticsStruct) As Integer
  414. Declare Function GetLocalTables Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, response As AllResponseData, responseData As LocalTablesStruct) As Integer
  415. Declare Function GetSpecificNetworkInfo Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, networkAddress&, responseData As SpecificNetworkInfoStruct) As Integer
  416. Declare Function GetSpecificServerInfo Lib "NWIPXSPX.DLL" (ByVal connectionID%, ByVal componentNumber%, server As ServerInfoStruct, response As AllResponseData, responseData As SpecificServerInfoStruct) As Integer
  417.  
  418.